import request from '@/utils/request'

/**
 * 查询公海客户列表
 * @param {Object} query 查询参数：{ keyword, pageNum, pageSize }
 */
export function listPublicLeads(query) {
  return request({
    url: '/api/public-leads',
    method: 'get',
    params: query
  })
}

/**
 * 查询公海客户详情
 * @param {number|string} leadId 客户ID
 */
export function getPublicLead(leadId) {
  return request({
    url: `/api/public-leads/${leadId}`,
    method: 'get'
  })
}

/**
 * 认领公海客户
 * @param {number|string} leadId 客户ID
 */
export function claimPublicLead(leadId) {
  return request({
    url: `/api/public-leads/${leadId}/claim`,
    method: 'put'
  })
}
